#include <bits/stdc++.h>
using namespace std;
long long n, a[100005], b[100005], m, k;
long long r(){
    long long x=0, f=1;
    char c=getchar();
    while(c>'9'||c<'0')if(c=='-')f=-1,c=getchar();else f=1,c=getchar();
    while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();
    return f*x;
}
int main(){
    freopen("duel.in","r", stdin);
    freopen("duel.out","w", stdout);
    n=r();
    for(int i = 0; i < n; i++)a[i]=r();
    sort(a, a+n);
    b[m]++;
    for(int i = 1; i < n; i++)if(a[i]!=a[i-1])b[++m]++;else b[m]++;
    for(int i = 0; i <= m; i++){
        n-=min(b[i],k);
        k+=b[i]-min(b[i],k);
    }
    cout<<n;
    return 0;
}
